package project.innovation.mooddiagnosis.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import project.innovation.mooddiagnosis.dao.FileMapper;
import project.innovation.mooddiagnosis.entity.file.FileInfo;
import project.innovation.mooddiagnosis.service.FileService;

import java.util.List;

@Service
public class FileServiceImpl implements FileService {
    @Autowired
    private FileMapper fileMapper;

    @Override
    public Integer addFile(FileInfo fileInfo){
        return fileMapper.insertFile(fileInfo);
    }

    @Override
    public Boolean selectFileByMd5(String md5){
        FileInfo fileInfo = fileMapper.selectFileByMd5(md5);
        return fileInfo != null;
    }

    @Override
    public List<FileInfo> selectFileList(){
        List<FileInfo> list = fileMapper.selectFileList();
        return list;
    }
}
